package com.moonLight.weblog.common.domain.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.moonLight.weblog.common.domain.dos.UserRoleDo;

import java.util.List;

public interface UserRoleMapper<UserRole> extends BaseMapper<UserRoleDo> {

    //跟据用户名进行查询返集合 默认方法可以实现
    default List<UserRoleDo> findByUserName(String userName){
        //封装条件
        LambdaQueryWrapper<UserRoleDo> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(UserRoleDo::getUsername,userName);
        //执行查询
        return selectList(wrapper);
    }




}
